package org.mixed.core.domain;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.mixed.core.event.EventAction;

@Getter
@Setter
@NoArgsConstructor
public class MixNotify {

	/**
	 * 消息来源(instanceId)
	 */
	private String from;

	/**
	 * 文件或文件夹id
	 */
	private String id;

	/**
	 * 动作
	 */
	private EventAction action;

	/**
	 * 操作对象，如接口、函数、分组、数据源
	 */
	private String type;

	/**
	 * WebSocket clientId
	 */
	private String clientId;

	/**
	 * WebSocket消息内容
	 */
	private String content;

	public MixNotify(String from) {
		this.from = from;
	}

	public MixNotify(String from, EventAction action, String clientId, String content) {
		this.from = from;
		this.clientId = clientId;
		this.action = action;
		this.content = content;
	}

	public MixNotify(String from, String id, EventAction action, String type) {
		this.from = from;
		this.id = id;
		this.action = action;
		this.type = type;
	}
}
